package com.allianz.webapps.controllers;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.allianz.webapps.https.interfaces.appCover.appEditCover.AppEditCover;
import com.allianz.webapps.https.interfaces.util.HttpsUtil;
import com.allianz.webapps.orderspojo.Cover;
import com.fasterxml.jackson.databind.ObjectMapper;

@Controller
@RequestMapping(value="main")
public class AppEditCoverController {
	@Autowired
	private ObjectMapper objectMapper;
	@Autowired
	private AppEditCover appEditCover;
	@RequestMapping("appeditcover")
	@ResponseBody
	public String appEditCover(@RequestParam(value="jsonParam") String jsonParam,HttpServletRequest request,HttpServletResponse response) throws Exception{
		Cover cover=objectMapper.readValue(jsonParam,Cover.class);
		String body1=HttpsUtil.httpsPost(appEditCover.requestAppEditCoverParam(cover));
		return body1;
	}
	@RequestMapping("coverPromptNotice")
	public String coverPromptNotice(HttpServletRequest request,HttpServletResponse response) throws Exception{
		return "views/page/coverPromptNotice";
	}
}
